package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FinanceCategoryMapper;
import com.ruoyi.system.domain.FinanceCategory;
import com.ruoyi.system.service.IFinanceCategoryService;

/**
 * 财务类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-18
 */
@Service
public class FinanceCategoryServiceImpl implements IFinanceCategoryService 
{
    @Autowired
    private FinanceCategoryMapper financeCategoryMapper;

    /**
     * 查询财务类别
     * 
     * @param id 财务类别主键
     * @return 财务类别
     */
    @Override
    public FinanceCategory selectFinanceCategoryById(Long id)
    {
        return financeCategoryMapper.selectFinanceCategoryById(id);
    }

    /**
     * 查询财务类别列表
     * 
     * @param financeCategory 财务类别
     * @return 财务类别
     */
    @Override
    public List<FinanceCategory> selectFinanceCategoryList(FinanceCategory financeCategory)
    {
        return financeCategoryMapper.selectFinanceCategoryList(financeCategory);
    }

    /**
     * 新增财务类别
     * 
     * @param financeCategory 财务类别
     * @return 结果
     */
    @Override
    public int insertFinanceCategory(FinanceCategory financeCategory)
    {
        financeCategory.setCreateTime(DateUtils.getNowDate());
        return financeCategoryMapper.insertFinanceCategory(financeCategory);
    }

    /**
     * 修改财务类别
     * 
     * @param financeCategory 财务类别
     * @return 结果
     */
    @Override
    public int updateFinanceCategory(FinanceCategory financeCategory)
    {
        return financeCategoryMapper.updateFinanceCategory(financeCategory);
    }

    /**
     * 批量删除财务类别
     * 
     * @param ids 需要删除的财务类别主键
     * @return 结果
     */
    @Override
    public int deleteFinanceCategoryByIds(Long[] ids)
    {
        return financeCategoryMapper.deleteFinanceCategoryByIds(ids);
    }

    /**
     * 删除财务类别信息
     * 
     * @param id 财务类别主键
     * @return 结果
     */
    @Override
    public int deleteFinanceCategoryById(Long id)
    {
        return financeCategoryMapper.deleteFinanceCategoryById(id);
    }

    @Override
    public List<FinanceCategory> findAll() {
        return financeCategoryMapper.findAll();
    }
}
